<?php
    if (!defined('APPPATH')) exit('No direct script access allowed');

    require_once(APPPATH.'libraries/utils/translation/class.translation.php');
    
    if(isset($_GET['lang']))
        $translate = new Translation($_GET['lang'], true);
    else {
        if(!empty($lang))
            $translate = new Translation($lang, true);
        else
            $translate = new Translation('en', true);
    }
?>

<h2><?php $translate->__('Language selector'); ?></h2>
<table class="table table-striped" cellpadding="0" cellspacing="0" width="100%">
    <thead>
        <tr>
            <th><?php $translate->__('Language'); ?></th>
        </tr>
    </thead>
    <tbody>
        <?php
            if (!empty($languages)) {
                foreach ($languages as $key => $language) {
        ?>
                    <tr>
                        <!-- restaurant customization -->
                        <td><a href="<?php echo site_url() . "/custom/restaurant/carte/" . $language['language_id'] ?>"><?php echo $language['name'] ?></a></td>
                    </tr>
        <?php
                }
            }
        ?>             
    </tbody>
</table>